Skip to content

Conversation

@icebound777
Copy link

@icebound777 icebound777 commented Oct 6, 2025

Decomp:

The end of a regular adventure race is supposed to remove the TOKEN_RACE flag from gGT->gameMode2.
However, due to an oversight, TOKEN_RACE is marked to be removed via sdata->Loading.OnBegin.RemBitsConfig0, which is used for gGT->gameMode1, the wrong gamemode field.

Due to this, finishing a CTR Token Challenge in Adventure Mode does not clear the token race flag. If you finish a CTR Token Challenge, then enter a track where you have not beaten the trophy race yet, then you will be thrown into the CTR Token Challenge right away.

This PR addresses this by assigning the TOKEN_RACE value to the correct RemBitsConfig field.

@kkv0n
Copy link
Contributor

kkv0n commented Oct 6, 2025

nice! according to commits history this wasnt even changed recently so i guess this bug was never noticed, good catch


RECTMENU_ClearInput();

sdata->Loading.OnBegin.AddBitsConfig0 |= ADVENTURE_ARENA;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Associated ghidra: image

I believe this block should be

//above the if statement
sdata->Loading.OnBegin.AddBitsConfig0 |= ADVENTURE_ARENA;
//inside the if statement
sdata->Loading.OnBegin.AddBitsConfig8 |= SPAWN_AT_BOSS;
sdata->Loading.OnBegin.RemBitsConfig0 |= ADVENTURE_BOSS;

I'm pretty sure that TOKEN_RACE doesn't belong here. Am I missing something
@niko1point0 what are your thoughts?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this may be a case of decomp moving gamemode logic to other modules. I'll see if I can find where the code originates from

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TheUbMunster
It's a regression caused by 0de8ca3:
sdata->Loading.OnBegin.RemBitsConfig8 |= TOKEN_RACE; was removed and swapped for the wrong RemBitsConfig field.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants